#
# Try to find FREENECT library and include path.
# Once done this will define
#
# FREENECT_FOUND
# FREENECT_INCLUDE_PATH
# FREENECT_LIBRARY
# 

IF (WIN32)
	FIND_PATH( FREENECT_INCLUDE_PATH libfreenect.h libfreenect.hpp
		$ENV{PROGRAMFILES}/include
		${PROJECT_SOURCE_DIR}/include
    		${PROJECT_SOURCE_DIR}/external_lib/include
		$ENV{PROGRAMFILES}/include/libfreenect
		${PROJECT_SOURCE_DIR}/include/libfreenect
    		${PROJECT_SOURCE_DIR}/external_lib/include/libfreenect
		DOC "The directory where libfreenect.h resides")
	FIND_LIBRARY( FREENECT_LIBRARY
		NAMES freenect freenect32 freenect32.lib
		PATHS
		$ENV{PROGRAMFILES}/lib
    		${PROJECT_SOURCE_DIR}/external_lib/lib
    		${PROJECT_SOURCE_DIR}/external_lib/dll
		DOC "The FREENECT library")
ELSE (WIN32)
	FIND_PATH( FREENECT_INCLUDE_PATH libfreenect.h libfreenect.hpp
		/usr/include
		/usr/local/include
		/sw/include
		/opt/local/include
		/usr/include/libfreenect
		/usr/local/include/libfreenect
		/sw/include/libfreenect
		/opt/local/include/libfreenect
		DOC "The directory where libfreenect.h resides")
	FIND_LIBRARY( FREENECT_LIBRARY
		NAMES FREENECT freenect
		PATHS
		/usr/lib64
		/usr/lib
		/usr/local/lib64
		/usr/local/lib
		/sw/lib
		/opt/local/lib
		DOC "The FREENECT library")
ENDIF (WIN32)

IF (FREENECT_INCLUDE_PATH)
	SET( FREENECT_FOUND ON)
ELSE (FREENECT_INCLUDE_PATH)
	FREENECT( FREENECT_FOUND OFF)
ENDIF (FREENECT_INCLUDE_PATH)

MARK_AS_ADVANCED( FREENECT_FOUND )
